package com.noble.glamour.bean.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.noble.glamour.bean.db.center.FProfileCache;
import com.noble.glamour.bean.db.msg.FLetter;
import com.noble.glamour.bean.db.msg.FMessage;
import com.noble.glamour.bean.db.unread.FUnRead;

/**
 * 创建DB Table
 */
public class DBHelper extends SQLiteOpenHelper {

    private static final int VERSION = 1;

    public DBHelper(Context context, String DBNAME) {
        super(context, DBNAME + ".db", null, VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // 执行CRUD有更改行为的SQL语句
        db.execSQL(FLetter.getCreateTable());      // 消息列表
        db.execSQL(FMessage.getCreateTable());      // 音视频消息
        db.execSQL(FUnRead.getCreateTable());       // 未读消息
        db.execSQL(FProfileCache.getCreateTable()); // 用户资料
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}
